//
//  LTOVESecToDays.m
//  dsad
//
//  Created by LTOVE on 16/8/4.
//  Copyright © 2016年 LTOVE. All rights reserved.
//

#import "LTOVESecToDays.h"

@implementation LTOVESecToDays
+ (NSString *)initWithSec:(NSUInteger)sec
{
    
//    NSTimeInterval *timeInt = 
    
//    NSUInteger month = sec /2592000;
//    NSUInteger day = sec % 2592000 /86400;
//    NSUInteger hour = sec % 2592000 % 86400 /3600;
//    NSUInteger minue = sec % 2592000 % 86400 % 3600 / 60;
//    NSUInteger seco = sec % 2592000 % 86400 % 3600 % 60;
//    NSUInteger month = sec /2592000;
//    NSUInteger day = sec % 2592000 /86400;
//    NSUInteger hour = sec % (2592000 * 86400) /3600;
//    NSUInteger minue = sec % 2592000 % 86400 % 3600 / 60;
//    NSUInteger seco = sec % 2592000 % 86400 % 3600 % 60;
////    NSUInteger a = 17 * 2592000 + 21 * 86400 + 11 * 3600 + 34 * 60 + 10;
//    
//    return [NSString stringWithFormat:@"%lu %lu月%lu %lu天%lu %lu时%lu %lu分%lu %lu秒",month / 10,month % 10, day / 10 ,day % 10,hour / 10 , hour % 10,minue / 10,hour % 10,seco / 10,seco % 10];
    
    int month = (int)sec / 2592000;
    int day = (int)sec % 2592000 /86400;
    int hour = (int)sec % 2592000 % 86400 /3600;
    int minue = (int)sec % 2592000 % 86400 % 3600 / 60;
    int seco = (int)sec % 2592000 % 86400 % 3600 % 60;
    //    NSUInteger a = 17 * 2592000 + 21 * 86400 + 11 * 3600 + 34 * 60 + 10;
    
    //    return [NSString stringWithFormat:@"%lu %lu月%lu %lu天%lu %lu时%lu %lu分%lu %lu秒",month / 10,month % 10, day / 10 ,day % 10,hour / 10 , hour % 10,minue / 10,hour % 10,seco / 10,seco % 10];
    return [NSString stringWithFormat:@"%d %d月%d %d日%d %d时%d %d分%d %d秒",month / 10,month % 10,day / 10,day % 10,hour / 10,hour % 10,minue / 10,minue % 10,seco / 10 ,seco % 10];
}

+ (NSString *)initNOFenKaiWithSec:(NSUInteger)sec
{
    NSUInteger month = sec /2592000;
    NSUInteger day = sec % 2592000 /86400;
    NSUInteger hour = sec % 2592000 % 86400 /3600;
    NSUInteger minue = sec % 2592000 % 86400 % 3600 / 60;
    NSUInteger seco = sec % 2592000 % 86400 % 3600 % 60;
    //    NSUInteger a = 17 * 2592000 + 21 * 86400 + 11 * 3600 + 34 * 60 + 10;
    
    return [NSString stringWithFormat:@"%lu月%lu天%lu时%lu分%lu秒",month,day,hour,minue,seco];
}

@end
